import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class test {
	public static void main(String[] args) {
		test t = new test();
		t.validateXLS();
	}

	
	public boolean validateXLS() {
		String xlsfile = "a.xls";
		String reg = "\\.xlsx$|\\.xls$";
		Pattern pattern = Pattern.compile(reg);
		Matcher m = pattern.matcher(xlsfile);
		boolean isXLS = m.find();
		System.out.println(isXLS);
		return isXLS;
	}
	
	public double formatnumber(double dayu) {
		double f = dayu / 1000.0;
		BigDecimal bg = new BigDecimal(f);
		double f1 = bg.setScale(4, BigDecimal.ROUND_HALF_UP).doubleValue();
		return f1;
	}

	public Double[] getRequirementArry(String coment) {
		String reg = "\\≥[\\d+]+(\\.\\d*)?";
		Pattern pattern = Pattern.compile(reg);
		Matcher m = pattern.matcher(coment);
		boolean isContainReferenceValues = m.find();
		System.out.println(isContainReferenceValues);
		int i = 0;
		List list = new ArrayList();
		while (isContainReferenceValues) {
			i++;
			String value = m.group();
			list.add(value);
			isContainReferenceValues = m.find();
		}
		int size = list.size();
		String temp = "";
		Double[] array2 = new Double[size];
		for (int x = 0; x < list.size(); x++) {
			temp = ((String) list.get(x)).replaceAll("≥", "");
			array2[x] = Double.parseDouble(temp);
		}
		return array2;
	}

	public double getRequirement(String coment) {
		Double i = 1.0;
		String reg = ".xls$";
		Pattern pattern = Pattern.compile(reg);
		Matcher m = pattern.matcher(coment);
		boolean isContainReferenceValues = m.find();
		System.out.println(isContainReferenceValues);
		if (isContainReferenceValues) {
			String value = m.group();
			// value = value.replaceAll("≥", "");
			// System.out.println(value);
			// i = Double.parseDouble(value);
			System.out.println(value);
		}
		return i;
	}

	public void test1() {
		String contents = "javaabedfdsfsdf秒>     hao   aoaojavadd>";
		// 以java开头,以>结束的字符串
		Pattern p = Pattern.compile("java.+?>");
		Matcher m = p.matcher(contents);
		while (m.find()) {
			System.out.println(contents.substring(m.start(), m.end()));
		}
	}

}
